<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str="eabcbae"
        function fn(str){
            for(var i=0;i<str.length;i++){
                if(str[i]==str[str.length-i-1]){
                    alert(str+"是回文字符串")
                    break
                }else{
                    alert(str+"不是回文字符串")
                    break
                }
            }
        }
        fn(str)
    </script>
</body>
</html>